<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>
        合同强制终结
    </title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="../../../css/main.css" media="all">
    <link rel="stylesheet" href="../../../lib/layui/css/layui_2.5.7.css">
    <script type="text/javascript" src="../../../lib/loading/okLoading.js"></script>
</head>
<style>

</style>

<body>
<div class="x-body" id="app">
    <form class="layui-form layui-form-pane" id="add">
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">

                <div class="layui-form-item">
                    <label class="layui-form-label">客户名称<span style="color: red;">*</span></label>
                    <div class="layui-input-block">
                        <input  autocomplete="off"  type="text" name="name" lay-filter="name" lay-verify="required" placeholder="客户名称" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item" style="margin-top: 8px;">
                    <label class="layui-form-label">证件类型</label>
                    <div class="layui-input-block">
                        <select name="codeType" lay-filter="codeType" >
                            <option value=""></option>
                            <option value="1">营业执照</option>
                            <option value="2">身份证号</option>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item" style="margin-top: 8px;">
                    <label class="layui-form-label">证件代码</label>
                    <div class="layui-input-block">
                        <input  autocomplete="off"  type="text" name="code" lay-filter="code" lay-verify="" placeholder="证件代码" class="layui-input">
                    </div>
                </div>

                <div style="text-align: center" class="layui-form-item">
                    <button class="layui-btn" type="button" lay-filter="sub" lay-submit="sub">
                        确定
                    </button>
                </div>
            </div>


        </div>

    </form>
</div>
<script type="text/javascript" src="../../../js/jquery.min.js"></script>
<script type="text/javascript" src="../../../js/myAjax.js"></script>
<script type="text/javascript" src="../../../js/pub.js"></script>
<script src="../../../lib/layui/layui2.5.7.js" charset="utf-8"></script>
<script src="../../../js/x-layui.js" charset="utf-8"></script>
<script src="../../../js/vue.min.js" charset="utf-8"></script>

<script>
    layui.use(['element', 'layer', 'form', 'laydate'], function () {
        $ = layui.jquery;//jquery
        lement = layui.element();//面包导航
        layer = layui.layer;//弹出层
        laydate = layui.laydate;//日期插件
        form = layui.form;
        okLoading.close($);
    })

</script>
<script>

    layui.use(['laydate', 'form', 'layer'],
        function () {
            var laydate = layui.laydate;
            var $ = layui.jquery;
            var form = layui.form;
            var layer = layui.layer;

            //监听审批提交
            form.on('submit(sub)',
                function (data) {
                    let form = data.field;
                    form.userId = $userId;

                    let request = {
                        url: 'xa/customer/addAndUpdate',
                        data: form,
                        method: "post",
                    };
                    sendRequest(request, (data) => {

                            if (data.code === 0) {
                            layer.alert("操作成功", {
                                    icon: 6
                                },
                                function () {
                                    var index = parent.layer.getFrameIndex(window.name);
                                    parent.layer.close(index);
                                    parent.reload();
                                });
                        } else {
                            layer.alert(data.msg, {
                                icon: 5
                            })
                        }

                    });
                    return false;
                });


        });

</script>

</body>

</html>
